package com.aaronprj.common.entities.mbooks;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import com.aaronprj.common.enums.mbooks.Course;
import com.aaronprj.common.enums.mbooks.ItemCategory;



@Entity
@NamedQueries( {
		@NamedQuery(name = "BookItem.findAll", query = "SELECT e FROM BookItem e"),
		@NamedQuery(name = "BookItem.findByCategory", query = "SELECT e FROM BookItem e WHERE e.category = :category"),
		@NamedQuery(name = "BookItem.findByCourse", query = "SELECT e FROM BookItem e WHERE e.course = :course")})
public class BookItem {

	private int id;
	private String name;
	private String discription;
	private ItemCategory category;
	private Course course;
	private String author;
	private String isdn;
	private String publisher;
	private double price;
	private int stock;
	private String imgpath;

	private int hits;
	

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}

	@Column(length=1000)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(length=4000)
	public String getDiscription() {
		return discription;
	}
	public void setDiscription(String discription) {
		this.discription = discription;
	}
	
	public ItemCategory getCategory() {
		return category;
	}
	public void setCategory(ItemCategory category) {
		this.category = category;
	}
	

	@Column(length=1000)
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public String getIsdn() {
		return isdn;
	}
	public void setIsdn(String isdn) {
		this.isdn = isdn;
	}

	@Column(length=1000)
	public String getPublisher() {
		return publisher;
	}
	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public Course getCourse() {
		return course;
	}
	public void setCourse(Course course) {
		this.course = course;
	}

	public int getStock() {
		return stock;
	}
	public void setStock(int stock) {
		this.stock = stock;
	}
	
	public String getImgpath() {
		return imgpath;
	}
	public void setImgpath(String imgpath) {
		this.imgpath = imgpath;
	}
	public int getHits() {
		return hits;
	}
	public void setHits(int hits) {
		this.hits = hits;
	}
	
	
}
